package com.yyh1;

public class Teacher extends School{
    //属性
    //讲课
    private String content;
    //无参构造
    public Teacher(String name, int age) {
        super(name, age);
    }
    //有参构造
    public Teacher(String name, int age, String content) {
        super(name, age);
        this.content = content;
    }
    //getter and setter
    public String getText() {
        return content;
    }

    public void setText(String text) {
        this.content = text;
    }
    //行为
    public void teach(){
        System.out.println("年龄为"+age+"的"+name+"正在亢奋的讲着"+content+"的知识");
    }
}
